package com.sicheng.lc.lc笔试.阿里篇;

import java.math.BigDecimal;
import java.util.Scanner;

/**
 * @author zsc
 * @version 1.0
 * @date 2022/4/28 20:21
 */
public class 切分数字和最大 {
    //输入 一串带小数点的字符串，将其切分成合法数字。切完后最大和
    // 输入说明: 连续数字的个数大于2
    // 123.0123.123===12,3.0,123.123 所有的数字都合法
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        int point = 0;
        int index = 0;
        for (int i = 0; i < line.length(); i++) {
            if (line.charAt(i) == '.') {
                point++;
                index = i;
            }
        }

        if (point == 1) {
            String s = line.substring(index + 2);
            String k =line.substring(0,index+2);
            System.out.println(new BigDecimal(s).add(new BigDecimal(k)));
        }
        if (point==2){
            String s = line.substring(index + 2);
            String k =line.substring(0,index+2);
            System.out.println(new BigDecimal(s).add(new BigDecimal(k)));
        }
    }
}
